package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import io.bdmc.modules.bss.model.CablePointVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 光缆 实体
 * </p>
 *
 * @author ping
 * @since 2020-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "FibreFibre对象", description = "光缆")
public class FibreFibre extends Model<FibreFibre> {

    private static final long serialVersionUID = 1L;

    // "自增id")
    @TableId(value = "fibre_id", type = IdType.AUTO)
    private Integer fibreId;

    // "设备Id")
    @FieldMeta(name = "设备Id", description = "设备Id")
    private Integer deviceId;

    // "端口号")
    @FieldMeta(name = "端口号", description = "端口号")
    private Integer channel;

    // "部门id")
    @FieldMeta(name = "部门id", description = "部门id")
    private Integer deptId;

    // "光缆名称")
    @FieldMeta(name = "光缆名称", description = "光缆名称")
    private String fibreName;

    // "光缆编号")
    @FieldMeta(name = "光缆编号", description = "光缆编号")
    private String fibreCode;

    // "光缆级别(1.一级2.二级3.三级4.四级)")
    @FieldMeta(name = "光缆级别(1.一级2.二级3.三级4.四级)", description = "光缆级别(1.一级2.二级3.三级4.四级)")
    private String fibreLevel;

    // "榄段类型(1.OPG2.ADSS3.OPSC4.普缆)")
    @FieldMeta(name = "榄段类型(1.OPG2.ADSS3.OPSC4.普缆)", description = "榄段类型(1.OPG2.ADSS3.OPSC4.普缆)")
    private Integer fibreType;
    // "纤芯数量")
    @FieldMeta(name = "纤芯数量", description = "纤芯数量")
    private Integer coreCount;

    // "光缆型号")
    @FieldMeta(name = "光缆型号", description = "光缆型号")
    private String fibreModel;

    // "光缆长度(km)")
    @FieldMeta(name = "光缆长度(km)", description = "光缆长度(km)")
    private BigDecimal fibreLength;

    // "投运时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @FieldMeta(name = "投运时间", description = "投运时间")
    private LocalDate operationDate;

    // "供应商")
    @FieldMeta(name = "供应商", description = "供应商")
    private String supplier;

    // "维护电话")
    @FieldMeta(name = "维护电话", description = "维护电话")
    private String serviceMobile;

    // "备注")
    @FieldMeta(name = "备注", description = "备注")
    private String remark;

    // "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    // "创建人")
    private String createBy;

    @TableField(exist = false)
    private List<CablePointVo> points;

    @TableField(exist = false)
    private List<FibreCablePoint> fibreCablePointList;

    @TableField(exist = false)
    private String alarmLocation;

    @Override
    public Serializable pkVal() {
        return this.fibreId;
    }

}
